@echo off
echo Building DevOps Platform with VC++2022...

call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64

cd /d D:\vc\devops-platform

if exist build rmdir /s /q build
mkdir build
cd build

cmake .. -G "Visual Studio 17 2022" -A x64
cmake --build . --config Release

if %errorlevel% equ 0 (
    echo SUCCESS: Built devops-platform.exe
    copy Release\devops-platform.exe ..\
) else (
    echo ERROR: Build failed
)
